package com.ijiuchuang.jc_localization.contract;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.PointF;

import com.ijiuchuang.jc_localization.base.BasePresenter;
import com.ijiuchuang.jc_localization.base.BaseView;
import com.ijiuchuang.jc_localization.bean.cache.TagCache;
import com.ijiuchuang.jc_localization.bean.event.SocketGetInfoEvent;
import com.ijiuchuang.jc_localization.bean.lite.Map;
import com.ijiuchuang.jc_localization.bean.lite.Station;

import java.net.Socket;
import java.util.List;

import rx.Subscriber;

/**
 * Created by Veev on 2016/6/30
 *
 * @link 384506557@qq.com
 */
public interface PositionContract {

    interface View extends BaseView<Presenter> {
        // do in here
        void initMap();
        void setMap(Bitmap bitmap);
        void addStations(Station ...stations);
        void showConnection(List<Socket> list);
        void setLocationPoint(PointF point);
        void setLocationPoint(String name, PointF point);
    }

    interface Presenter extends BasePresenter {
        // do in here
        void loadConfig();
        void socketConnect();
        void getSocketList();
    }

    interface Model {
        // do in here
        void getMap(Context context, Subscriber<Map> subscriber);
        void loadMap(Context context, Subscriber<Bitmap> subscriber);
        void loadStations(Context context, Subscriber<List<Station>> subscriber);
        void closeSocket(String address);
        void closeSocket(Socket socket);
        void closeAllSocket();
        List<Socket> getSocketList();
        void socketConnect(Subscriber<SocketGetInfoEvent> subscriber);
        void locationProcess(SocketGetInfoEvent socketGetInfoEvent, Subscriber<TagCache> subscriber);
    }
}
